package model

import modelApp.EdicionHobbiesAppModel
import org.uqbar.arena.layout.VerticalLayout
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.WindowOwner
import templates.EdicionAtributos
import templates.MyOwnSimpleWindow

class EditarHobbiesView extends MyOwnSimpleWindow<EdicionHobbiesAppModel>{
	
	@Property EdicionAtributos template = new EdicionAtributos
	
	new(WindowOwner parent, Villano villano) {
		super(parent, new EdicionHobbiesAppModel(villano) )
	}
	
	override createContents(Panel mainPanel) {
		this.setTitle("Editar Hobbies")
		mainPanel.setLayout(new VerticalLayout)
	
		this.template.listaEliminable(mainPanel,"Hobbies","villanoSeleccionado.hobbies","hobbieDel", [| modelObject.quitarHobbie])
	
		this.template.agregarAtributoTBox(mainPanel, "nuevoHobbie", [| modelObject.agregarHobbie /*---> */  modelObject.nuevoHobbie = " "], [| close])
		
		}

}